import { createRouter, createWebHistory } from "vue-router";
import Layout from "@/layout/index.vue";
import LoginView from "@/views/LoginView.vue";
import layoutMenus from "./components/menus"; // 导入统一路由配置

const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes: [
		{
			path: "/login",
			name: "login",
			component: LoginView,
		},
		{
			path: "/",
			name: "index",
			component: Layout,
			redirect: "/dashboard",
			children: layoutMenus,
		},
	],
});

export default router;
